<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dita PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<dita>
  <topic id="topic1">
    <title>pgbouncer</title>
    <body>
      <p>Manages database connection pools.</p>
      <section>
        <title>Synopsis</title>
        <codeblock>pgbouncer [OPTION ...] <varname>config.ini</varname>

  OPTION
   [ -d | --daemon ]
   [ -R | --restart ]
   [ -q | --quiet ]
   [ -v | --verbose ]
   [ {-u | --user}=<varname>username</varname> ]

pgbouncer [ -V | --version ] | [ -h | --help ]</codeblock>
      </section>
      <section>
        <title>Description</title>
        <p>PgBouncer is a light-weight connection pool manager for Greenplum and PostgreSQL
          databases. Databases may be on different Greenplum Database clusters or PostgreSQL
          backends. PgBouncer creates a pool for each database user and database combination. A
          pooled connection can only be reused for another connection request for the same user and
          database. The client application connects to the connection pool's host and port instead
          of the Greenplum Database master host and port. PgBouncer either creates a new database
          connection for the client or reuses an existing connection. When the client disconnects,
          the connection is returned to the pool for re-use. </p>
        <p>PgBouncer supports the standard connection interface that PostgreSQL and Greenplum
          Database share. A client requesting a database connection provides the host name and port
          where PgBouncer is running, as well as the database name, username, and password.
          PgBouncer looks up the requested database (which may be an alias for the actual database)
          in its configuration file to find the host name, port, and database name for the database
          connection. The configuration file entry also determines how to authenticate the user and
          what database role will be used for the connection—a "forced user" can override the
          username provided with the client's connection request. </p>
        <p>PgBouncer requires an authentication file, a text file that contains a list of users and
          passwords. Passwords may be either clear text, MD5-encoded, or an LDAP/AD lookup string.
          You can also set up PgBouncer to query the <codeph>pg_shadow</codeph> table in the
          destination database for users that are not in the authentication file. </p>
        <p>PgBouncer shares connections in one of three pool modes:<ul id="ul_jyx_rvg_cs">
            <li><i>Session pooling</i> – When a client connects, a connection is assigned to it as
              long as it remains connected. When the client disconnects, the connection is placed
              back into the pool.</li>
            <li><i>Transaction pooling</i> – A connection is assigned to a client for the duration
              of a transaction. When PgBouncer notices the transaction is done, the connection is
              placed back into the pool. This mode can be used only with applications that do not
              use features that depend upon a session. </li>
            <li><i>Statement pooling</i> – Statement pooling is like transaction pooling, but
              multi-statement transactions are not allowed. This mode is intended to enforce
              autocommit mode on the client and is targeted for PL/Proxy on PostgreSQL.</li>
          </ul></p>
        <p>A default pool mode can be set for the PgBouncer instance and the mode can be overridden
          for individual databases and users. </p>
        <p>By connecting to a virtual <codeph>pgbouncer</codeph> database, you can monitor and
          manage PgBouncer using SQL-like commands. Configuration parameters can be changed without
          having to restart PgBouncer, and the configuration file can be reloaded to pick up
          changes.</p>
        <p>PgBouncer does not yet support SSL connections. If you want to encrypt traffic between
          clients and PgBouncer, you can use <xref href="https://www.stunnel.org" format="html"
            scope="external">stunnel</xref>, a free software utility that creates TLS-encrypted
          tunnels using the OpenSSL cryptography library. See "Securing PgBouncer Connections with
          stunnel" in the <i>Greenplum Database Administrator Guide</i> for directions.</p>
        <p>See the <xref href="https://pgbouncer.github.io/faq.html" format="html" scope="external"
            >PgBouncer FAQ</xref> for additional usage information.</p>
        <p>This reference topic includes the following additional reference information:<ul
            id="ul_us1_z1b_dt">
            <li><xref href="#topic_xpj_bhp_fs" format="dita"/></li>
            <li><xref href="#topic_v4s_htc_gs" format="dita"/></li>
            <li><xref href="#topic_fvj_k1p_fs" format="dita"/></li>
          </ul></p>
      </section>
      <section>
        <title>Options</title>
        <parml>
          <plentry>
            <pt>-d | --daemon</pt>
            <pd>Run PgBouncer as a daemon (a background process). The default is to run as a
              foreground process.</pd>
            <pd>PgBouncer displays start up messages when starting as a daemon. To disable the
              display of messages add the <codeph>-q</codeph> option.</pd>
            <pd>To shut down a PgBouncer daemon, log in to the administration console and issue the
                <codeph>SHUTDOWN</codeph> command. <note>This option does not work on Windows
                servers. </note></pd>
          </plentry>
          <plentry>
            <pt>-R | --restart </pt>
            <pd>Restart PgBouncer using the specified command line arguments. Non-TLS connections to
              databases are maintained during restart; TLS connections are dropped.</pd>
            <pd>If you specify only the <codeph>-R</codeph> option, PgBouncer displays log
              information on the command line after restart. To restart PgBouncer as a daemon
              specify the options <codeph>-Rd</codeph>.<note>Works only if the operating system
                supports Unix sockets and the PgBouncer configuration has no
                  <codeph>unix_socket_dir</codeph>. This option does not work on Windows servers.
              </note></pd>
          </plentry>
          <plentry>
            <pt>-q | --quiet </pt>
            <pd>Run quietly. Do not display messages on the command line (stdout).</pd>
          </plentry>
          <plentry>
            <pt>-v | --verbose</pt>
            <pd>Increase message verbosity. Display additional messages. Can be used multiple
              times.</pd>
          </plentry>
          <plentry>
            <pt>{-u | --user}=<varname>username</varname></pt>
            <pd>The PgBouncer process assumes the identity of <varname>username</varname>.</pd>
          </plentry>
          <plentry>
            <pt>-V | --version</pt>
            <pd>Show version and exit.</pd>
          </plentry>
          <plentry>
            <pt>-h | --help</pt>
            <pd>Show help message and exit.</pd>
          </plentry>
        </parml>
      </section>
    </body>
    <topic id="topic_xpj_bhp_fs">
      <title>PgBouncer Configuration File</title>
      <body>
        <p>The PgBouncer configuration file (usually <codeph>pgbouncer.ini</codeph>) is in the "ini"
          format. Section names are enclosed in square braces (<codeph>[</codeph> and
            <codeph>]</codeph>). Lines beginning with "<codeph>;</codeph>" or "<codeph>#</codeph>"
          are comments and are ignored. The characters "<codeph>;</codeph>" and "<codeph>#</codeph>"
          are not recognized when they appear later in the line.</p>
        <section>
          <title>Synopsis</title>
          <codeblock>[databases]
db = ...

[pgbouncer]
...

[users]
...</codeblock>
        </section>
        <section>
          <title>Description</title>
        </section>
        <p>A PgBouncer configuration file has up to three sections:<ul id="ul_kwg_vll_gs">
            <li><xref href="#topic_fmd_ckd_gs" format="dita"/></li>
            <li><xref href="#topic_orc_gkd_gs" format="dita"/></li>
            <li><xref href="#topic_lzk_zjd_gs" format="dita"/></li>
          </ul></p>
      </body>
      <topic id="topic_fmd_ckd_gs">
        <title>[databases] Section</title>
        <body>
          <p>The databases section contains key=value pairs, where the key is a database name and
            the value is a libpq connect-string list of key=value pairs. </p>
          <p>A database name can contain characters <codeph>[0-9A-Za-z_.-]</codeph> without quoting.
            Names that contain other chars must be quoted with standard SQL identifier quoting<ul
              id="ul_wzm_b4p_ts">
              <li>Enclose names in double quotes (<codeph>"</codeph>)</li>
              <li>Represent a double-quote within an identifier with two consecutive double quote
                characters</li>
            </ul></p>
          <p>The database name <codeph>"*"</codeph> is the fallback database. The value for this key
            is a connect string for the requested database. Automatically created database entries
            like these are cleaned up if they remain idle longer then the time specified in
              <codeph>autodb_idle_timeout</codeph> parameter.</p>
          <p>The PgBouncer configuration file can contain <codeph>%include</codeph> directives,
            which specify another filee to read and process. This allows splitting the configuration
            file into separate parts. For example:<codeblock>%include filename</codeblock></p>
          <section>
            <title>Location Parameters</title>
            <p>The following parameters may be included in the value to specify the location of the
              database. </p>
            <parml>
              <plentry>
                <pt>dbname</pt>
                <pd>The destination database name.<p>Default: same as the client-side database
                    name.</p></pd>
              </plentry>
              <plentry>
                <pt>host</pt>
                <pd>The name or IP address of the Greenplum master host. Host names are resolved at
                  connect time. If DNS returns several results, they are used in a round-robin
                  manner. The DNS result is cached and the <codeph>dns_max_ttl</codeph> parameter
                  determines when the cache entry expires. </pd>
                <pd>
                  <p>Default: not set, means the connection is made through a Unix socket.</p>
                </pd>
              </plentry>
              <plentry>
                <pt>port</pt>
                <pd>The Greenplum Database master port. Default: 5432</pd>
              </plentry>
              <plentry>
                <pt>user, password</pt>
                <pd>If <codeph>user=</codeph> is set, all connections to the destination database
                  are made with the specified user. This means there will be just one pool for the
                    database.<p>If the <codeph>user=</codeph> parameter is not set, PgBouncer
                    attempts to log in to the destination database with the user name passed by the
                    client. This means there will be one pool for each user who connects to the
                    database.</p></pd>
              </plentry>
              <plentry>
                <pt>auth_user</pt>
                <pd>If <codeph>auth_user</codeph> is set, any user who is not specified in
                    <codeph>auth_file</codeph> is authenticated by querying the
                    <varname>pg_shadow</varname> table in the database as the
                    <codeph>auth_user</codeph>. The <codeph>auth_user</codeph> password must be set
                  in the <varname>auth_file</varname>.</pd>
              </plentry>
            </parml>
          </section>
          <section>
            <title>Pool Configuration</title>
            <parml>
              <plentry>
                <pt>pool_size</pt>
                <pd>Set maximum size of pools for this database. If not set, the
                    <codeph>default_pool_size</codeph> is used.</pd>
              </plentry>
              <plentry>
                <pt>connect_query</pt>
                <pd>Query to be run after a connection is established, but before allowing the
                  connection to be used by any clients. If the query raises errors, they are logged
                  but ignored otherwise.</pd>
              </plentry>
              <plentry>
                <pt>pool_mode</pt>
                <pd>Set the pool mode for this database. If not set, the default
                    <codeph>pool_mode</codeph> is used.</pd>
              </plentry>
              <plentry>
                <pt>max_db_connections</pt>
                <pd>
                  <p>Set a database-wide maximum number of connections for this database. The total
                    number of connections for all pools for this database will not exceed this
                    value.</p>
                </pd>
              </plentry>
            </parml>
          </section>
          <section>
            <title>Extra Parameters</title>
            <p>The following parameters allow setting default parameters on server connections.</p>
            <p>Note that since version 1.1 PgBouncer tracks client changes for their values, so
              their use in <codeph>pgbouncer.ini</codeph> is deprecated now.</p>
            <parml>
              <plentry>
                <pt>client_encoding</pt>
                <pd>Ask specific <codeph>client_encoding</codeph> from server.</pd>
              </plentry>
              <plentry>
                <pt>datestyle</pt>
                <pd>Ask specific <codeph>datestyle</codeph> from server.</pd>
              </plentry>
              <plentry>
                <pt>timezone</pt>
                <pd>Ask specific <codeph>timezone</codeph> from server.</pd>
              </plentry>
            </parml>
          </section>
        </body>
      </topic>
      <topic id="topic_orc_gkd_gs">
        <title>[pgbouncer] Section</title>
        <body>
          <section>
            <parml>
              <plentry>
                <pt>logfile</pt>
                <pd>Specifies the location of the log file. The log file is kept open. After log
                  rotation run <codeph>kill -HUP</codeph> or run the <codeph>RELOAD;</codeph>
                  command in the PgBouncer Administration Console. <p>Default: not set.</p><note> On
                    Windows machines, the service must be stopped and started</note>.</pd>
              </plentry>
              <plentry>
                <pt>pidfile</pt>
                <pd>The name of the pid file. Without a pidfile, PgBouncer cannot be run as a
                  background process (daemon).<p>Default: not set.</p></pd>
              </plentry>
              <plentry>
                <pt>listen_addr</pt>
                <pd>A list of interface addresses where PgBouncer listens for TCP connections. You
                  may also use <codeph>*</codeph>, which means to listen on all interfaces. If not
                  set, only Unix socket connections are allowed.<p>Addresses can be specified
                    numerically (IPv4/IPv6) or by name.</p><p>Default: not set</p></pd>
              </plentry>
              <plentry>
                <pt>listen_port</pt>
                <pd>Which port to listen on. Applies to both TCP and Unix sockets.<p>Default:
                    6432</p></pd>
              </plentry>
              <plentry>
                <pt>unix_socket_dir</pt>
                <pd>Specifies location for Unix sockets. Applies to both listening socket and server
                  connections. If set to an empty string, Unix sockets are disabled. Required for
                  online reboot (<codeph>-R</codeph> option) to work. <note>Not supported on Windows
                    machines. </note><p>Default: <codeph>/tmp</codeph></p></pd>
              </plentry>
              <plentry>
                <pt>unix_socket_mode</pt>
                <pd>Filesystem mode for Unix socket.<p>Default: 0777</p></pd>
              </plentry>
              <plentry>
                <pt>unix_socket_group</pt>
                <pd>Group name to use for Unix socket.<p>Default: not set</p></pd>
              </plentry>
              <plentry>
                <pt>user</pt>
                <pd>If set, specifies the Unix user to change to after startup. This only works if
                  PgBouncer is started as root or if <codeph>user</codeph> is the same as the
                  current user. Note: Not supported on Windows machines.<p>Default: not set</p></pd>
              </plentry>
              <plentry>
                <pt>auth_file</pt>
                <pd>The name of the file containing the user names and passwords to load. The file
                  format is the same as the Greenplum Database <filepath>pg_auth/pg_pwd</filepath>
                  file, so this parameter can be set to one of those backend files. See <xref
                    href="#topic_v4s_htc_gs" format="dita">Authentication File Format</xref> for
                    details.<p>Default: not set.</p></pd>
              </plentry>
              <plentry>
                <pt>auth_type</pt>
                <pd>How to authenticate users.<parml>
                    <plentry>
                      <pt>cert</pt>
                      <pd>Clients must connect with TLS using a valid client certificate. The
                        client's username is taken from CommonName field in the certificate.</pd>
                    </plentry>
                    <plentry>
                      <pt>md5</pt>
                      <pd>Use MD5-based password check. <codeph>auth_file</codeph> may contain both
                        MD5-encrypted or plain-text passwords. This is the default authentication
                        method.</pd>
                    </plentry>
                    <plentry>
                      <pt>plain</pt>
                      <pd>Clear-text password is sent over wire. <i>Deprecated</i>.</pd>
                    </plentry>
                    <plentry>
                      <pt>trust</pt>
                      <pd>No authentication is done. The username must still exist in the
                          <codeph>auth_file</codeph>.</pd>
                    </plentry>
                    <plentry>
                      <pt>any</pt>
                      <pd>Like the <codeph>trust</codeph> method, but the username supplied is
                        ignored. Requires that all databases are configured to log in with a
                        specific user. Additionally, the console database allows any user to log in
                        as admin.</pd>
                    </plentry>
                  </parml></pd>
              </plentry>
              <plentry>
                <pt>auth_query</pt>
                <pd>Query to load a user's password from database. If a user does not exist in the
                    <codeph>auth_file</codeph> and the database entry includes an
                    <codeph>auth_user</codeph>, this query is run in the database as
                    <codeph>auth_user</codeph> to lookup up the user. <p>Default: <codeph>SELECT
                      usename, passwd FROM pg_shadow WHERE usename=$1</codeph></p></pd>
              </plentry>
              <plentry>
                <pt>pool_mode</pt>
                <pd>Specifies when a server connection can be reused by other clients.<parml>
                    <plentry>
                      <pt>session</pt>
                      <pd>Connection is returned to the pool when the client disconnects.
                        Default.</pd>
                    </plentry>
                    <plentry>
                      <pt>transaction</pt>
                      <pd>Connection is returned to the pool when the transaction finishes.</pd>
                    </plentry>
                    <plentry>
                      <pt>statement</pt>
                      <pd>Connection is returned to the pool when the current query finishes. Long
                        transactions with multiple statements are disallowed in this mode.</pd>
                    </plentry>
                  </parml></pd>
              </plentry>
              <plentry>
                <pt>max_client_conn</pt>
                <pd>Maximum number of client connections allowed. When increased then the file
                  descriptor limits should also be increased. The actual number of file descriptors
                  used is more than <codeph>max_client_conn</codeph>. The theoretical maximum used,
                  when each user connects with its own username to the server
                    is:<codeblock>max_client_conn + (max_pool_size * total_databases * total_users)</codeblock><p>
                    If a database user is specified in the connect string, all users connect using
                    the same username. Then the theoretical maximum connections
                    is:</p><codeblock>max_client_conn + (max_pool_size * total_databases)</codeblock><p>The
                    theoretical maximum should be never reached, unless somone deliberately crafts a
                    load for it. Still, it means you should set the number of file descriptors to a
                    safely high number. Search for <codeph>ulimit</codeph> in your operating system
                    documentation. <note>
                      <codeph>ulimit</codeph> does not apply in a Windows
                    environment.</note></p><p>Default: 100</p></pd>
              </plentry>
              <plentry>
                <pt>default_pool_size</pt>
                <pd>The number of server connections to allow per user/database pair. This can be
                  overridden in the per-database configuration.<p>Default: 20</p></pd>
              </plentry>
              <plentry>
                <pt>min_pool_size</pt>
                <pd>Add more server connections to the pool when it is lower than this number. This
                  improves behavior when the usual load drops and then returns suddenly after a
                  period of total inactivity.<p>Default: 0 (disabled)</p></pd>
              </plentry>
              <plentry>
                <pt>reserve_pool_size</pt>
                <pd>The number of additional connections to allow for a pool. 0 disables.<p>Default:
                    0 (disabled)</p></pd>
              </plentry>
              <plentry>
                <pt>reserve_pool_timeout</pt>
                <pd>If a client has not been serviced in this many seconds, PgBouncer enables use of
                  additional connections from reserve pool. 0 disables.<p>Default: 5.0</p></pd>
              </plentry>
              <plentry>
                <pt>max_db_connections</pt>
                <pd>The maximum number of connections per database. If you hit the limit, closing a
                  client connection to one pool does not immediately allow a server connection to be
                  established for another pool, because the server connection for the first pool is
                  still open. Once the server connection closes (due to idle timeout), a new server
                  connection will be opened for the waiting pool.<p>Default: unlimited</p></pd>
              </plentry>
              <plentry>
                <pt>max_user_connections</pt>
                <pd>The maximum number of connections per-user. When you hit the limit, closing a
                  client connection to one pool does not immediately allow a connection to be
                  established for another pool, because the connection for the first pool is still
                  open. After the connection for the first pool has closed (due to idle timeout), a
                  new server connection is opened for the waiting pool.</pd>
              </plentry>
              <plentry>
                <pt>server_round_robin</pt>
                <pd>By default, PgBouncer reuses server connections in LIFO (last-in, first-out)
                  order, so that a few connections get the most load. This provides the best
                  performance when a single server serves a database. But if there is TCP
                  round-robin behind a database IP, then it is better if PgBouncer also uses
                  connections in that manner to achieve uniform load.<p>Default: 0</p></pd>
              </plentry>
              <plentry>
                <pt>ignore_startup_parameters</pt>
                <pd>By default, PgBouncer allows only parameters it can keep track of in startup
                  packets: <codeph>client_encoding</codeph>, <codeph>datestyle</codeph>,
                    <codeph>timezone</codeph>, and
                    <codeph>standard_conforming_strings</codeph>.<p>All others parameters raise an
                    error. To allow other parameters, specify them here so that PgBouncer can ignore
                    them.</p><p>Default: empty</p></pd>
              </plentry>
              <plentry>
                <pt>disable_pqexec</pt>
                <pd>Disable Simple Query protocol (PQexec). Unlike Extended Query protocol, Simple
                  Query protocol allows multiple queries in one packet, which allows some classes of
                  SQL-injection attacks. Disabling it can improve security. This means that only
                  clients that exclusively use Extended Query protocol will work.<p>Default:
                  0</p></pd>
              </plentry>
              <plentry>
                <pt>application_name_add_host</pt>
                <pd>Add the client host address and port to the application name setting set on
                  connection start. This helps in identifying the source of bad queries. The setting
                  is overwritten without detection if the application runs <codeph>SET
                    APPLICATION_NAME</codeph> after connecting. <p>Default: 1</p></pd>
              </plentry>
            </parml>
          </section>
          <section>
            <title>Log Settings</title>
            <parml>
              <plentry>
                <pt>syslog</pt>
                <pd>Toggles syslog on and off. On Windows, eventlog is used instead.<p>Default:
                    0</p></pd>
              </plentry>
              <plentry>
                <pt>syslog_ident</pt>
                <pd>Under what name to send logs to syslog.<p>Default:
                    <codeph>pgbouncer</codeph></p></pd>
              </plentry>
              <plentry>
                <pt>syslog_facility</pt>
                <pd>Under what facility to send logs to syslog. Some possibilities are:
                    <codeph>auth</codeph>, <codeph>authpriv</codeph>, <codeph>daemon</codeph>,
                    <codeph>user</codeph>, <codeph>local0-7</codeph><p>Default:
                      <codeph>daemon</codeph></p></pd>
              </plentry>
              <plentry>
                <pt>log_connections</pt>
                <pd>Log successful logins.<p>Default: 1</p></pd>
              </plentry>
              <plentry>
                <pt>log_disconnections</pt>
                <pd>Log disconnections, with reasons.<p>Default: 1</p></pd>
              </plentry>
              <plentry>
                <pt>log_pooler_errors</pt>
                <pd>Log error messages that the pooler sends to clients.<p>Default: 1</p></pd>
              </plentry>
              <plentry>
                <pt>stats_period</pt>
                <pd>How often to write aggregated statistics to the log. <p>Default: 60</p></pd>
              </plentry>
            </parml>
          </section>
          <section>
            <title>Console Access Control</title>
            <parml>
              <plentry>
                <pt>admin_users</pt>
                <pd>Comma-separated list of database users that are allowed to connect and run all
                  commands on console. Ignored when <codeph>auth_mode=any</codeph>, in which case
                  any username is allowed in as admin.<p>Default: empty</p></pd>
              </plentry>
              <plentry>
                <pt>stats_users</pt>
                <pd>Comma-separated list of database users that are allowed to connect and run
                  read-only queries on console. That means all SHOW commands except SHOW
                    FDS.<p>Default: empty.</p></pd>
              </plentry>
            </parml>
          </section>
          <section>
            <title>Connection Sanity Checks, Timeouts</title>
            <parml>
              <plentry>
                <pt>server_reset_query</pt>
                <pd>Query sent to server on connection release, before making it available to other
                  clients. At that moment no transaction is in progress so it should not include
                    <codeph>ABORT</codeph> or <codeph>ROLLBACK</codeph>.<p>A good choice for
                    Postgres 8.2 and below, and Greenplum Database,
                    is:</p><codeblock>server_reset_query = RESET ALL; SET SESSION AUTHORIZATION DEFAULT;
</codeblock><p>For
                    Postgres 8.3 and above, the following is
                    sufficient:</p><codeblock>server_reset_query = DISCARD ALL;
</codeblock><p>When
                    transaction pooling is used, the <codeph>server_reset_query</codeph> should be
                    empty, as clients should not use any session features. If clients do use session
                    features, they will be broken because transaction pooling does not guarantee
                    that the next query will run on the same connection.</p><p>Default:
                      <codeph>RESET ALL; SET SESSION AUTHORIZATION DEFAULT;</codeph></p></pd>
              </plentry>
              <plentry>
                <pt>server_reset_query_always</pt>
                <pd>
                  <p>Whether <codeph>server_reset_query</codeph> should be run in all pooling modes.
                    When this setting is off (default), the <codeph>server_reset_query</codeph> will
                    be run only in pools that are in sessions pooling mode. Connections in
                    transaction pooling mode should not have any need for reset query.</p>
                  <p>Default: 0</p>
                </pd>
              </plentry>
              <plentry>
                <pt>server_check_delay</pt>
                <pd>How long to keep released connections available for re-use without running
                  sanity-check queries on it. If 0 then the query is run always.<p>Default:
                  30.0</p></pd>
              </plentry>
              <plentry>
                <pt>server_check_query</pt>
                <pd>A simple do-nothing query to test the server connection.<p>If an empty string,
                    then sanity checking is disabled.</p><p>Default: SELECT 1;</p></pd>
              </plentry>
              <plentry>
                <pt>server_lifetime</pt>
                <pd>The pooler tries to close server connections that have been connected longer
                  than this number of seconds. Setting it to 0 means the connection is to be used
                  only once, then closed.<p>Default: 3600.0</p></pd>
              </plentry>
              <plentry>
                <pt>server_idle_timeout</pt>
                <pd>If a server connection has been idle more than this many seconds it is dropped.
                  If this parameter is set to 0, timeout is disabled. [seconds]<p>Default:
                  600.0</p></pd>
              </plentry>
              <plentry>
                <pt>server_connect_timeout</pt>
                <pd>If connection and login will not finish in this number of seconds, the
                  connection will be closed. <p>Default: 15.0</p></pd>
              </plentry>
              <plentry>
                <pt>server_login_retry</pt>
                <pd>If a login fails due to failure from <codeph>connect()</codeph> or
                  authentication, the pooler waits this many seconds before retrying to connect.
                    <p>Default: 15.0</p></pd>
              </plentry>
              <plentry>
                <pt>client_login_timeout</pt>
                <pd>If a client connects but does not manage to login in this number of seconds, it
                  is disconnected. This is needed to avoid dead connections stalling
                    <codeph>SUSPEND</codeph> and thus online restart.<p>Default: 60.0</p></pd>
              </plentry>
              <plentry>
                <pt>autodb_idle_timeout</pt>
                <pd>If database pools created automatically (via "*") have been unused this many
                  seconds, they are freed. Their statistics are also forgotten. <p>Default:
                    3600.0</p></pd>
              </plentry>
              <plentry>
                <pt>dns_max_ttl</pt>
                <pd>How long to cache DNS lookups, in seconds. If a DNS lookup returns several
                  answers, PgBouncer round-robins between them in the meantime. The actual DNS TTL
                  is ignored. <p>Default: 15.0</p></pd>
              </plentry>
              <plentry>
                <pt>dns_nxdomain_ttl</pt>
                <pd>How long error and NXDOMAIN DNS lookups can be cached, in seconds.<p>Default:
                    15.0</p></pd>
              </plentry>
              <plentry>
                <pt>dns_zone_check_period</pt>
                <pd>Period to check if zone serial numbers have changed.<p>PgBouncer can collect DNS
                    zones from hostnames (everything after first dot) and then periodically check if
                    the zone serial numbers change. If changes are detected, all hostnames in that
                    zone are looked up again. If any host IP changes, its connections are
                    invalidated.</p><p>Works only with UDNS backend (<codeph>--with-udns</codeph> to
                    configure).</p><p>Default: 0.0 (disabled)</p></pd>
              </plentry>
            </parml>
          </section>
          <section>
            <title>Dangerous Timeouts</title>
            <p>Setting the following timeouts can cause unexpected errors.</p>
            <parml>
              <plentry>
                <pt>query_timeout</pt>
                <pd>Queries running longer than this (seconds) are canceled. This parameter should
                  be used only with a slightly smaller server-side
                    <codeph>statement_timeout</codeph>, to trap queries with network problems.
                    [seconds]<p>Default: 0.0 (disabled)</p></pd>
              </plentry>
              <plentry>
                <pt>query_wait_timeout</pt>
                <pd>The maximum time, in seconds, queries are allowed to wait for execution. If the
                  query is not assigned a connection during that time, the client is disconnected.
                  This is used to prevent unresponsive servers from grabbing up
                    connections.<p>Default: 0.0 (disabled)</p></pd>
              </plentry>
              <plentry>
                <pt>client_idle_timeout</pt>
                <pd>Client connections idling longer than this many seconds are closed. This should
                  be larger than the client-side connection lifetime settings, and only used for
                  network problems.<p>Default: 0.0 (disabled)</p></pd>
              </plentry>
              <plentry>
                <pt>idle_transaction_timeout</pt>
                <pd>If client has been in "idle in transaction" state longer than this (seconds), it
                  is disconnected. <p>Default: 0.0 (disabled)</p></pd>
              </plentry>
            </parml>
          </section>
          <!--<section><title>TLS settings</title><parml><plentry><pt>client_tls_sslmode</pt><pd>TLS mode to use for connections from clients. TLS connections are disabled by default. When enabled, <codeph>client_tls_key_file</codeph> and <codeph>client_tls_cert_file</codeph> must be also configured to set up the key and certificate PgBouncer uses to accept client connections.<ul id="ul_dgn_drd_bt"><li><codeph>disabled</codeph>: Plain TCP. If client requests TLS, it’s ignored. Default.</li><li><codeph>allow</codeph>: If client requests TLS, it is used. If not, plain TCP is used. If client uses client-certificate, it is not validated.</li><li><codeph>prefer</codeph>: Same as <codeph>allow</codeph>.</li><li><codeph>require</codeph>: Client must use TLS. If not, client connection is rejected. If client uses client-certificate, it is not validated.</li><li><codeph>verify-ca</codeph>: Client must use TLS with valid client certificate.</li><li><codeph>verify-full</codeph>: Same as <codeph>verify-ca</codeph>.</li></ul></pd></plentry><plentry><pt>client_tls_key_file</pt><pd>Private key for PgBouncer to accept client connections.</pd><pd>Default: not set.</pd></plentry><plentry><pt>client_tls_cert_file</pt><pd>Root certificate file to validate client certificates.</pd><pd>Default: unset.</pd></plentry><plentry><pt>client_tls_ca_file</pt><pd>Root certificate to validate client certificates.</pd><pd>Default: unset.</pd></plentry><plentry><pt>client_tls_protocols</pt><pd>Which TLS protocol versions are allowed. </pd><pd>Valid values: are <codeph>tlsv1.0</codeph>, <codeph>tlsv1.1</codeph>, <codeph>tlsv1.2</codeph>. </pd><pd>Shortcuts: <codeph>all</codeph> (<codeph>tlsv1.0</codeph>,<codeph>tlsv1.1</codeph>,<codeph>tlsv1.2</codeph>), <codeph>secure</codeph> (<codeph>tlsv1.2</codeph>), <codeph>legacy</codeph> (<codeph>all</codeph>).</pd><pd>Default: <codeph>all</codeph>.</pd></plentry><plentry><pt>client_tls_ciphers</pt><pd>Default: <codeph>fast</codeph>.</pd></plentry><plentry><pt>client_tls_ecdhcurve</pt><pd>Elliptic Curve name to use for ECDH key exchanges.</pd><pd>Allowed values: <codeph>none</codeph> (DH is disabled), <codeph>auto</codeph> (256-bit ECDH), curve name.</pd><pd>Default: auto</pd></plentry><plentry><pt>client_tls_dheparams</pt><pd>DHE key exchange type.</pd><pd>Allowed values: <codeph>none</codeph> (DH is disabled), <codeph>auto</codeph> (2048-bit DH), <codeph>legacy</codeph> (1024-bit DH).</pd><pd>Default: <codeph>auto</codeph>.</pd></plentry><plentry><pt>server_tls_sslmode</pt><pd>TLS mode to use for connections to Greenplum Database and PostgreSQL servers. TLS connections are disabled by default.<ul id="ul_hyh_1td_bt"><li><codeph>disabled</codeph>: Plain TCP. TLS is not requested from the server. Default.</li><li><codeph>allow</codeph>: If server rejects plain, try TLS. (<i>PgBouncer Documentation is speculative on this..</i>)</li><li><codeph>prefer</codeph>: Same as <codeph>allow</codeph>.</li><li><codeph>require</codeph>: Connection must use TLS. If server rejects it, plain TCP is not attempted. Server certificate is not validated.</li><li><codeph>verify-ca</codeph>: Connection must use TLS and server certificate must be valid according to <codeph>server_tls_ca_file</codeph>. The server hostname is not verfied against the certificate.</li><li><codeph>verify-full</codeph>: Connection must use TLS and the server certificate must be valid according to <codeph>server_tls_ca_file</codeph>. The server hostname must match the hostname in the certificate.</li></ul></pd></plentry><plentry><pt>server_tls_ca_file</pt><pd>Path to the root certificate file used to validate Greenplum Database and PostgreSQL server certificates.</pd><pd>Default: unset.</pd></plentry><plentry><pt>server_tls_key_file</pt><pd>The private key for PgBouncer to authenticate against Greenplum Database or PostgreSQL server.</pd><pd>Default: not set.</pd></plentry><plentry><pt>server_tls_cert_file</pt><pd>Certificate for private key. Greenplum Database or PostgreSQL servers can validate it.</pd><pd>Default: not set.</pd></plentry><plentry><pt>server_tls_protocols</pt><pd>Which TLS protocol versions are allowed. </pd><pd>Valid values are: <codeph>tlsv1.0</codeph>, <codeph>tlsv1.1</codeph>, <codeph>tlsv1.2</codeph>. </pd><pd>Shortcuts: <codeph>all</codeph> (<codeph>tlsv1.0</codeph>, <codeph>tlsv1.1</codeph>, <codeph>tlsv1.2</codeph>); <codeph>secure</codeph> (<codeph>tlsv1.2</codeph>); <codeph>legacy</codeph> (<codeph>all</codeph>).</pd><pd>Default: <codeph>all</codeph>.</pd></plentry><plentry><pt>server_tls_ciphers</pt><pd>Default: <codeph>fast</codeph>.</pd></plentry></parml></section>-->
          <section>
            <title>Low-level Network Settings</title>
            <parml>
              <plentry>
                <pt>pkt_buf</pt>
                <pd>Internal buffer size for packets. Affects the size of TCP packets sent and
                  general memory usage. Actual libpq packets can be larger than this so there is no
                  need to set it large.<p>Default: 2048</p></pd>
              </plentry>
              <plentry>
                <pt>max_packet_size</pt>
                <pd>Maximum size for packets that PgBouncer accepts. One packet is either one query
                  or one result set row. A full result set can be larger.<p>Default:
                  2147483647</p></pd>
              </plentry>
              <plentry>
                <pt>listen_backlog</pt>
                <pd>Backlog argument for the <codeph>listen(2)</codeph> system call. It how many new
                  unanswered connection attempts are kept in queue. When the queue is full, further
                  new connection attempts are dropped.<p>Default: 128</p></pd>
              </plentry>
              <plentry>
                <pt>sbuf_loopcnt</pt>
                <pd>How many times to process data on one connection, before proceeding. Without
                  this limit, one connection with a big result set can stall PgBouncer for a long
                  time. One loop processes one <codeph>pkt_buf</codeph> amount of data. 0 means no
                    limit.<p>Default: 5</p></pd>
              </plentry>
              <plentry>
                <pt>suspend_timeout</pt>
                <pd>How many seconds to wait for buffer flush during <codeph>SUSPEND</codeph> or
                  reboot (<codeph>-R</codeph>). Connection is dropped if flush does not
                    succeed.<p>Default: 10</p></pd>
              </plentry>
              <plentry>
                <pt>tcp_defer_accept</pt>
                <pd>For details on this and other TCP options, please see the tcp(7) man
                    page.<p>Default: 45 on Linux, otherwise 0</p></pd>
              </plentry>
              <plentry>
                <pt>tcp_socket_buffer</pt>
                <pd>Default: not set</pd>
              </plentry>
              <plentry>
                <pt>tcp_keepalive</pt>
                <pd>Turns on basic keepalive with OS defaults.<p>On Linux, the system defaults are
                      <codeph>tcp_keepidle=7200</codeph>, <codeph>tcp_keepintvl=75</codeph>,
                      <codeph>tcp_keepcnt=9</codeph>. </p><p>Default: 1</p></pd>
              </plentry>
              <plentry>
                <pt>tcp_keepcnt</pt>
                <pd>Default: not set</pd>
              </plentry>
              <plentry>
                <pt>tcp_keepidle</pt>
                <pd>Default: not set</pd>
              </plentry>
              <plentry>
                <pt>tcp_keepintvl</pt>
                <pd>Default: not set</pd>
              </plentry>
            </parml>
          </section>
        </body>
      </topic>
      <topic id="topic_lzk_zjd_gs">
        <title>[users] Section</title>
        <body>
          <p>This section contains <i>key=value</i> pairs, where the key is a user name and the
            value is a libpq connect-string list of key=value pairs. </p>
          <p>
            <b>Pool configuration</b>
          </p>
          <parml>
            <plentry>
              <pt>pool_mode</pt>
              <pd>Set the pool mode to be used for all connections from this user. If not set, the
                database or default <codeph>pool_mode</codeph> is used.</pd>
            </plentry>
          </parml>
        </body>
      </topic>
    </topic>
    <topic id="topic_xw4_dtc_gs">
      <title>Example Configuration Files</title>
      <body>
        <p>
          <b>Minimal Configuration</b>
        </p>
        <codeblock>[databases]
postgres = host=127.0.0.1 dbname=postgres auth_user=gpadmin

[pgbouncer]
pool_mode = session
listen_port = 6543
listen_addr = 127.0.0.1
auth_type = md5
auth_file = users.txt
logfile = pgbouncer.log
pidfile = pgbouncer.pid
admin_users = someuser
stats_users = stat_collector
</codeblock>
        <p>Use connection parameters passed by the client:</p>
        <codeblock>[databases]
* =

[pgbouncer]
listen_port = 65432
listen_addr = 0.0.0.0
auth_type = trust
auth_file = bouncer/users.txt
logfile = pgbouncer.log
pidfile = pgbouncer.pid
ignore_startup_parameters=options</codeblock>
        <p>
          <b>Database Defaults</b>
        </p>
        <codeblock>[databases]

; foodb over unix socket
foodb =

; redirect bardb to bazdb on localhost
bardb = host=127.0.0.1 dbname=bazdb

; access to destination database will go with single user
forcedb = host=127.0.0.1 port=300 user=baz password=foo client_encoding=UNICODE datestyle=ISO
</codeblock>
      </body>
    </topic>
    <topic id="topic_v4s_htc_gs">
      <title>PgBouncer Authentication File Format</title>
      <body>
        <p>PgBouncer requires its own user database, a text file in following format:</p>
        <codeblock>"username1" "password" ...
"username2" "md5abcdef012342345" ...</codeblock>
        <p>There is one line per user. Each line must have at least two fields. Fields are enclosed
          in double quotes (<codeph>"</codeph>). The first field is the user name and the second is
          either a plain-text or an MD5-encoded password. The remainder of the line is ignored.</p>
        <p>This file format is similar to text files used by Greenplum Database for authentication
          information, and PgBouncer can work directly with the Greenplum Database authentication
          files.</p>
        <p>To avoid plain-text passwords, encode user passwords with MD5. The format for an MD5
          encoded password is: </p>
        <codeblock>"md5" + md5(password + username)</codeblock>
        <p>For example, the following command generates the MD5 string for the user
            <codeph>admin</codeph> with password <codeph>1234</codeph>:</p>
        <codeblock>$ echo -n "1234admin" | md5sum
$ 45f2603610af569b6155c45067268c6b</codeblock>
        <p>The MD5-hidden password is:<codeblock>md545f2603610af569b6155c45067268c6b</codeblock></p>
      </body>
    </topic>
    <topic id="topic_fvj_k1p_fs">
      <title>PgBouncer Administration Console Commands</title>
      <body>
        <p>The PgBouncer Administration Console is accessed by connecting to the database
            <codeph>pgbouncer</codeph>.</p>
        <codeblock>$ psql -p 6543 pgbouncer
</codeblock>
        <p>Only users listed in configuration parameters <codeph>admin_users</codeph> or
            <codeph>stats_users</codeph> can log in to the console. However, when
            <codeph>auth_mode=any</codeph>, then any user may log in as a
            <codeph>stats_user</codeph>.</p>
        <p>The user name <codeph>pgbouncer</codeph> may also log in without a password through a
          Unix socket if the client has the same Unix user UID as the running process.</p>
      </body>
      <topic id="topic_bk3_3jc_dt">
        <title>Administration Console Command Syntax</title>
        <body>
          <codeblock>pgbouncer=# show help;
NOTICE:  Console usage
DETAIL:
       SHOW HELP|CONFIG|DATABASES|POOLS|CLIENTS|SERVERS|VERSION
	SHOW STATS|FDS|SOCKETS|ACTIVE_SOCKETS|LISTS|MEM
	SHOW DNS_HOSTS|DNS_ZONES
	SET key = arg
	RELOAD
	PAUSE [&lt;db>]
	RESUME [&lt;db>]
	DISABLE &lt;db>
	ENABLE &lt;db>
	KILL &lt;db>
	SUSPEND
	SHUTDOWN</codeblock>
        </body>
      </topic>
      <topic id="topic_bf5_jcl_gs">
        <title>Administration Commands</title>
        <body>
          <p>From the PgBouncer Administrator console you can control connections between PgBouncer
            and Greenplum Database. You can also set PgBouncer configuration parameters. </p>
          <p>The following PgBouncer administration commands control the PgBouncer process.</p>
          <parml>
            <plentry>
              <pt>PAUSE [<varname>database</varname>]</pt>
              <pd>If no database is specified, PgBouncer tries to disconnect from all servers, first
                waiting for all queries to complete. The command will not return before all queries
                are finished. This command is to be used to prepare to restart the database.</pd>
              <pd>If a database name is specified, only that database is paused.</pd>
              <pd>If you run a <codeph>PAUSE <varname>database</varname></codeph> command, and then
                a <codeph>PAUSE</codeph> command to pause all databases, you must run two
                  <codeph>RESUME</codeph> commands, one for all databases, and one for the named
                database.</pd>
            </plentry>
            <plentry>
              <pt>SUSPEND</pt>
              <pd>All socket buffers are flushed and PgBouncer stops listening for data on them. The
                command will not return before all buffers are empty. To be used when rebooting
                PgBouncer online.</pd>
            </plentry>
            <plentry>
              <pt>RESUME [ <varname>database</varname> ]</pt>
              <pd>Resume work from a previous <codeph>PAUSE</codeph> or <codeph>SUSPEND</codeph>
                command.</pd>
              <pd>If a database was specified for the <codeph>PAUSE</codeph> command, the database
                must also be specified with the <codeph>RESUME</codeph> command.</pd>
              <pd>After pausing all databases with the <codeph>PAUSE</codeph> command, resuming a
                single database with <codeph>RESUME <varname>database</varname></codeph> is not
                supported.</pd>
            </plentry>
            <plentry>
              <pt>DISABLE <varname>database</varname></pt>
              <pd>Reject all new client connections on the database.</pd>
            </plentry>
            <plentry>
              <pt>ENABLE <varname>database</varname></pt>
              <pd>Allow new client connections on the database.</pd>
            </plentry>
            <plentry>
              <pt>KILL <varname>database</varname></pt>
              <pd>Immediately drop all client and server connections to the named database.</pd>
            </plentry>
            <plentry>
              <pt>SHUTDOWN</pt>
              <pd>Stop PgBouncer process. To exit from the <codeph>psql</codeph> command line
                session, enter <codeph>\q</codeph>.</pd>
            </plentry>
            <plentry>
              <pt>RELOAD</pt>
              <pd>The PgBouncer process reloads the current configuration file and updates the
                changeable settings.</pd>
            </plentry>
            <plentry>
              <pt>SET <varname>key</varname> = <varname>value</varname></pt>
              <pd>Override specified configuration setting. See the <xref href="#CONFIG"
                  format="dita"><codeph>SHOW CONFIG;</codeph></xref> command.</pd>
            </plentry>
          </parml>
        </body>
      </topic>
      <topic id="topic_zfh_2dl_gs">
        <title>SHOW Command</title>
        <body>
          <p>The <codeph>SHOW <varname>category</varname></codeph> command displays different types
            of PgBouncer information. You can specify one of the following categories:<ul
              id="ul_ims_tgl_gs">
              <li><xref href="#ACTIVE_SOCKETS" format="dita">ACTIVE_SOCKETS</xref></li>
              <li><xref href="#CLIENTS" format="dita">CLIENTS</xref></li>
              <li><xref href="#CONFIG" format="dita">CONFIG</xref></li>
              <li><xref href="#DATABASES" format="dita">DATABASES</xref></li>
              <li><xref href="#DNS_ZONES" format="dita">DNS_ZONES</xref></li>
              <li><xref href="#FDS" format="dita">FDS</xref></li>
              <li><xref href="#POOLS" format="dita">POOLS</xref></li>
              <li><xref href="#SERVERS" format="dita">SERVERS</xref></li>
              <li><xref href="#STATS" format="dita">STATS</xref></li>
              <li>
                <xref href="#LISTS" format="dita">LISTS</xref></li>
              <li>
                <xref href="#MEM" format="dita">MEM</xref></li>
              <li><xref href="#USERS" format="dita">USERS</xref></li>
              <li><xref href="#VERSION" format="dita">VERSION</xref></li>
            </ul></p>
        </body>
        <topic id="ACTIVE_SOCKETS">
          <title>ACTIVE_SOCKETS</title>
          <body>
            <table frame="all" id="table_smh_1hl_gs">
              <title>Active Socket Information</title>
              <tgroup cols="2">
                <colspec colname="c1" colnum="1" colwidth="1*"/>
                <colspec colname="c2" colnum="2" colwidth="2.7*"/>
                <thead>
                  <row>
                    <entry>Column</entry>
                    <entry>Description</entry>
                  </row>
                </thead>
                <tbody>
                  <row>
                    <entry>type</entry>
                    <entry>S, for server, C for client.</entry>
                  </row>
                  <row>
                    <entry>user</entry>
                    <entry>Username <codeph>pgbouncer</codeph> uses to connect to server.</entry>
                  </row>
                  <row>
                    <entry>database</entry>
                    <entry>Database name.</entry>
                  </row>
                  <row>
                    <entry>state</entry>
                    <entry>State of the server connection, one of <codeph>active</codeph>,
                        <codeph>used</codeph> or <codeph>idle</codeph>.</entry>
                  </row>
                  <row>
                    <entry>addr</entry>
                    <entry>IP address of PostgreSQL server.</entry>
                  </row>
                  <row>
                    <entry>port</entry>
                    <entry>Port of PostgreSQL server.</entry>
                  </row>
                  <row>
                    <entry>local_addr</entry>
                    <entry>Connection start address on local machine.</entry>
                  </row>
                  <row>
                    <entry>local_port</entry>
                    <entry>Connection start port on local machine.</entry>
                  </row>
                  <row>
                    <entry>connect_time</entry>
                    <entry>When the connection was made.</entry>
                  </row>
                  <row>
                    <entry>request_time</entry>
                    <entry>When last request was issued.</entry>
                  </row>
                  <row>
                    <entry>ptr</entry>
                    <entry>Address of internal object for this connection. Used as unique
                      ID.</entry>
                  </row>
                  <row>
                    <entry>link</entry>
                    <entry>Address of client connection the server is paired with.</entry>
                  </row>
                  <row>
                    <entry>recv_pos</entry>
                    <entry>Receive position in the I/O buffer.</entry>
                  </row>
                  <row>
                    <entry>pkt_pos</entry>
                    <entry>Parse position in the I/O buffer.</entry>
                  </row>
                  <row>
                    <entry>pkt_remain</entry>
                    <entry>Number of packets remaining on the socket.</entry>
                  </row>
                  <row>
                    <entry>send_pos</entry>
                    <entry>Send position in the packet.</entry>
                  </row>
                  <row>
                    <entry>send_remain</entry>
                    <entry>Total packet length remaining to send.</entry>
                  </row>
                  <row>
                    <entry>pkt_avail</entry>
                    <entry>Amount of I/O buffer left to parse.</entry>
                  </row>
                  <row>
                    <entry>send_avail</entry>
                    <entry>Amount of I/O buffer left to send.</entry>
                  </row>
                </tbody>
              </tgroup>
            </table>
          </body>
        </topic>
        <topic id="CLIENTS">
          <title>CLIENTS</title>
          <body>
            <table frame="all" id="table_dkj_2dl_gs">
              <title>Clients</title>
              <tgroup cols="2">
                <colspec colname="c1" colnum="1" colwidth="1*"/>
                <colspec colname="c2" colnum="2" colwidth="2.7*"/>
                <thead>
                  <row>
                    <entry>Column</entry>
                    <entry>Description</entry>
                  </row>
                </thead>
                <tbody>
                  <row>
                    <entry>type</entry>
                    <entry>C, for client.</entry>
                  </row>
                  <row>
                    <entry>user</entry>
                    <entry>Client connected user.</entry>
                  </row>
                  <row>
                    <entry>database</entry>
                    <entry>Database name.</entry>
                  </row>
                  <row>
                    <entry>state</entry>
                    <entry>State of the client connection, one of <codeph>active</codeph>,
                        <codeph>used</codeph>, <codeph>waiting</codeph> or
                      <codeph>idle</codeph>.</entry>
                  </row>
                  <row>
                    <entry>addr</entry>
                    <entry>IP address of client, or <codeph>unix</codeph> for a socket
                      connection.</entry>
                  </row>
                  <row>
                    <entry>port</entry>
                    <entry>Port client is connected to.</entry>
                  </row>
                  <row>
                    <entry>local_addr</entry>
                    <entry>Connection end address on local machine.</entry>
                  </row>
                  <row>
                    <entry>local_port</entry>
                    <entry>Connection end port on local machine.</entry>
                  </row>
                  <row>
                    <entry>connect_time</entry>
                    <entry>Timestamp of connect time.</entry>
                  </row>
                  <row>
                    <entry>request_time</entry>
                    <entry>Timestamp of latest client request.</entry>
                  </row>
                  <row>
                    <entry>ptr</entry>
                    <entry>Address of internal object for this connection. Used as unique
                      ID.</entry>
                  </row>
                  <row>
                    <entry>link</entry>
                    <entry>Address of server connection the client is paired with.</entry>
                  </row>
                  <row>
                    <entry>remote_pid</entry>
                    <entry>Process ID, if client connects with Unix socket and the OS supports
                      getting it.</entry>
                  </row>
                </tbody>
              </tgroup>
            </table>
          </body>
        </topic>
        <topic id="CONFIG">
          <title>CONFIG</title>
          <body>
            <p>List of current PgBouncer parameter settings</p>
            <table frame="all" id="table_d2j_2dl_gs">
              <title>Config</title>
              <tgroup cols="2">
                <colspec colname="c1" colnum="1" colwidth="1*"/>
                <colspec colname="c2" colnum="2" colwidth="2.7*"/>
                <thead>
                  <row>
                    <entry>Column</entry>
                    <entry>Description</entry>
                  </row>
                </thead>
                <tbody>
                  <row>
                    <entry>key</entry>
                    <entry> Configuration variable name</entry>
                  </row>
                  <row>
                    <entry>value</entry>
                    <entry> Configuration value</entry>
                  </row>
                  <row>
                    <entry>changeable</entry>
                    <entry>Either <codeph>yes</codeph> or <codeph>no</codeph>. Shows whether the
                      variable can be changed while running. If <codeph>no</codeph>, the variable
                      can be changed only at boot time.</entry>
                  </row>
                </tbody>
              </tgroup>
            </table>
          </body>
        </topic>
        <topic id="DATABASES">
          <title>DATABASES</title>
          <body>
            <table frame="all" id="table_gfj_2dl_gs">
              <title>Databases</title>
              <tgroup cols="2">
                <colspec colname="c1" colnum="1" colwidth="1*"/>
                <colspec colname="c2" colnum="2" colwidth="2.7*"/>
                <thead>
                  <row>
                    <entry>Column</entry>
                    <entry>Description</entry>
                  </row>
                </thead>
                <tbody>
                  <row>
                    <entry>name</entry>
                    <entry>Name of configured database entry.</entry>
                  </row>
                  <row>
                    <entry>host</entry>
                    <entry>Host pgbouncer connects to.</entry>
                  </row>
                  <row>
                    <entry>port</entry>
                    <entry>Port pgbouncer connects to.</entry>
                  </row>
                  <row>
                    <entry>database</entry>
                    <entry>Actual database name pgbouncer connects to.</entry>
                  </row>
                  <row>
                    <entry>force_user </entry>
                    <entry>When user is part of the connection string, the connection between
                      pgbouncer and the database server is forced to the given user, whatever the
                      client user.</entry>
                  </row>
                  <row>
                    <entry>pool_size</entry>
                    <entry>Maximum number of server connections.</entry>
                  </row>
                  <row>
                    <entry>reserve_pool</entry>
                    <entry>The number of additional connections that can be created if the pool
                      reaches <codeph>pool_size</codeph>.</entry>
                  </row>
                  <row>
                    <entry>pool_mode</entry>
                    <entry>The database's override <codeph>pool_mode</codeph> or NULL if the default
                      will be used instead.</entry>
                  </row>
                  <row>
                    <entry>max_connections</entry>
                    <entry>Maximum number of connections for all pools for this database.</entry>
                  </row>
                  <row>
                    <entry>current_connections</entry>
                    <entry>The total count of connections for all pools for this database.</entry>
                  </row>
                </tbody>
              </tgroup>
            </table>
            <p/>
          </body>
        </topic>
        <topic id="DNS_ZONES">
          <title>DNS_ZONES</title>
          <body>
            <table frame="all" id="table_r4k_2dl_gs">
              <title>DNS Zones in Cache</title>
              <tgroup cols="2">
                <colspec colname="c1" colnum="1" colwidth="1*"/>
                <colspec colname="c2" colnum="2" colwidth="2.7*"/>
                <thead>
                  <row>
                    <entry>Column</entry>
                    <entry>Description</entry>
                  </row>
                </thead>
                <tbody>
                  <row>
                    <entry>zonename</entry>
                    <entry>Zone name</entry>
                  </row>
                  <row>
                    <entry>serial</entry>
                    <entry>Current DNS serial number</entry>
                  </row>
                  <row>
                    <entry>count</entry>
                    <entry>Hostnames belonging to this zone</entry>
                  </row>
                </tbody>
              </tgroup>
            </table>
          </body>
        </topic>
        <topic id="FDS">
          <title>FDS</title>
          <body>
            <p><codeph>SHOW FDS</codeph> is an internal command used for an online restart, for
              example when upgrading to a new PgBouncer version. It shows a list of file descriptors
              in use with the internal state attached to them. This command blocks the internal
              event loop, so it should not be used while PgBouncer is in use.</p>
            <p>When the connected user has username "pgbouncer", connects through a Unix socket, and
              has the same UID as the running process, the actual file descriptors are passed over
              the connection. Note: This does not work on Windows machines.</p>
            <table frame="all" id="table_ugj_2dl_gs">
              <title>FDS</title>
              <tgroup cols="2">
                <colspec colname="c1" colnum="1" colwidth="1*"/>
                <colspec colname="c2" colnum="2" colwidth="2.7*"/>
                <thead>
                  <row>
                    <entry>Column</entry>
                    <entry>Description</entry>
                  </row>
                </thead>
                <tbody>
                  <row>
                    <entry>fd</entry>
                    <entry>File descriptor numeric value.</entry>
                  </row>
                  <row>
                    <entry>task</entry>
                    <entry>One of <codeph>pooler</codeph>, <codeph>client</codeph>, or
                        <codeph>server</codeph>.</entry>
                  </row>
                  <row>
                    <entry>user</entry>
                    <entry>User of the connection using the file descriptor.</entry>
                  </row>
                  <row>
                    <entry>database</entry>
                    <entry>Database of the connection using the file descriptor.</entry>
                  </row>
                  <row>
                    <entry>addr</entry>
                    <entry>IP address of the connection using the file descriptor, "unix" if a Unix
                      socket is used.</entry>
                  </row>
                  <row>
                    <entry>port</entry>
                    <entry>Port used by the connection using the file descriptor.</entry>
                  </row>
                  <row>
                    <entry>cancel</entry>
                    <entry>Cancel key for this connection.</entry>
                  </row>
                  <row>
                    <entry>link</entry>
                    <entry>File descriptor for corresponding server/client. NULL if idle.</entry>
                  </row>
                  <row>
                    <entry>client_encoding</entry>
                    <entry>Character set used for the database.</entry>
                  </row>
                  <row>
                    <entry>std_strings</entry>
                    <entry>This controls whether ordinary string literals ('...') treat backslashes
                      literally, as specified in the SQL standard. </entry>
                  </row>
                  <row>
                    <entry>datestyle</entry>
                    <entry>Display format for date and time values. </entry>
                  </row>
                  <row>
                    <entry>timezone</entry>
                    <entry>The timezone for interpreting and displaying time stamps. </entry>
                  </row>
                </tbody>
              </tgroup>
            </table>
          </body>
        </topic>
        <topic id="LISTS">
          <title>LISTS</title>
          <body>
            <p>Shows the following PgBouncer statistics in two columns: the item label and value.</p>
            <table frame="all" id="table_sqj_2dl_gs">
              <title>Count of PgBouncer Items</title>
              <tgroup cols="2">
                <colspec colname="c1" colnum="1" colwidth="1*"/>
                <colspec colname="c2" colnum="2" colwidth="2.7*"/>
                <thead>
                  <row>
                    <entry>Item</entry>
                    <entry>Description</entry>
                  </row>
                </thead>
                <tbody>
                  <row>
                    <entry>databases</entry>
                    <entry>Count of databases.</entry>
                  </row>
                  <row>
                    <entry>users</entry>
                    <entry>Count of users.</entry>
                  </row>
                  <row>
                    <entry>pools</entry>
                    <entry>Count of pools.</entry>
                  </row>
                  <row>
                    <entry>free_clients</entry>
                    <entry>Count of free clients.</entry>
                  </row>
                  <row>
                    <entry>used_clients</entry>
                    <entry>Count of used clients.</entry>
                  </row>
                  <row>
                    <entry>login_clients</entry>
                    <entry>Count of clients in <codeph>login</codeph> state.</entry>
                  </row>
                  <row>
                    <entry>free_servers</entry>
                    <entry>Count of free servers.</entry>
                  </row>
                  <row>
                    <entry>used_servers</entry>
                    <entry>Count of used servers.</entry>
                  </row>
                  <row>
                    <entry>dns_names</entry>
                    <entry>Count of DNS names.</entry>
                  </row>
                  <row>
                    <entry>dns_zones </entry>
                    <entry>Count of DNS zones.</entry>
                  </row>
                  <row>
                    <entry>dns_queries</entry>
                    <entry>Count of DNS queries.</entry>
                  </row>
                  <row>
                    <entry>dns_pending</entry>
                    <entry>Count of in-flight DNS queries.</entry>
                  </row>
                </tbody>
              </tgroup>
            </table>
          </body>
        </topic>
        <topic id="MEM">
          <title>MEM</title>
          <body>
            <p>Shows cache memory information for these PgBouncer caches:<ul id="ul_uzj_2dl_gs">
                <li>user_cache</li>
                <li>db_cache </li>
                <li>pool_cache </li>
                <li>server_cache </li>
                <li>client_cache </li>
                <li>iobuf_cache </li>
              </ul></p>
            <table frame="all" id="table_ghk_2dl_gs">
              <title>In Memory Cache</title>
              <tgroup cols="2">
                <colspec colname="c1" colnum="1" colwidth="1*"/>
                <colspec colname="c2" colnum="2" colwidth="2.7*"/>
                <thead>
                  <row>
                    <entry>Column</entry>
                    <entry>Description</entry>
                  </row>
                </thead>
                <tbody>
                  <row>
                    <entry>name</entry>
                    <entry>Name of cache.</entry>
                  </row>
                  <row>
                    <entry>size</entry>
                    <entry>The size of a single slot in the cache. </entry>
                  </row>
                  <row>
                    <entry>used</entry>
                    <entry>Number of used slots in the cache. </entry>
                  </row>
                  <row>
                    <entry>free</entry>
                    <entry>The number of available slots in the cache.</entry>
                  </row>
                  <row>
                    <entry>memtotal</entry>
                    <entry>Total bytes used by the cache.</entry>
                  </row>
                </tbody>
              </tgroup>
            </table>
          </body>
        </topic>
        <topic id="POOLS">
          <title>POOLS</title>
          <body>
            <p>A new pool entry is made for each pair of (database, user).</p>
            <table frame="all" id="table_n3j_2dl_gs">
              <title>Pools</title>
              <tgroup cols="2">
                <colspec colname="c1" colnum="1" colwidth="1*"/>
                <colspec colname="c2" colnum="2" colwidth="2.7*"/>
                <thead>
                  <row>
                    <entry>Column</entry>
                    <entry>Description</entry>
                  </row>
                </thead>
                <tbody>
                  <row>
                    <entry>database</entry>
                    <entry>Database name.</entry>
                  </row>
                  <row>
                    <entry>user</entry>
                    <entry>User name.</entry>
                  </row>
                  <row>
                    <entry>cl_active</entry>
                    <entry>Client connections that are linked to server connection and can process
                      queries.</entry>
                  </row>
                  <row>
                    <entry>cl_waiting</entry>
                    <entry>Client connections have sent queries but have not yet got a server
                      connection.</entry>
                  </row>
                  <row>
                    <entry>sv_active</entry>
                    <entry>Server connections that linked to client.</entry>
                  </row>
                  <row>
                    <entry>sv_idle</entry>
                    <entry>Server connections that are unused and immediately usable for client
                      queries.</entry>
                  </row>
                  <row>
                    <entry>sv_used</entry>
                    <entry>Server connections that have been idle more than
                        <codeph>server_check_delay</codeph>. The <codeph>server_check_query</codeph>
                      query must be run on them before they can be used.</entry>
                  </row>
                  <row>
                    <entry>sv_tested</entry>
                    <entry>Server connections that are currently running either
                        <codeph>server_reset_query</codeph> or
                      <codeph>server_check_query</codeph>.</entry>
                  </row>
                  <row>
                    <entry>sv_login</entry>
                    <entry>Server connections currently in process of logging in.</entry>
                  </row>
                  <row>
                    <entry>maxwait</entry>
                    <entry>How long the first (oldest) client in the queue has waited, in seconds.
                      If this begins to increase, the current pool of servers does not handle
                      requests fast enough. The cause may be either an overloaded server or the
                        <codeph>pool_size</codeph> setting is too small.</entry>
                  </row>
                  <row>
                    <entry>pool_mode</entry>
                    <entry>The pooling mode in use.</entry>
                  </row>
                </tbody>
              </tgroup>
            </table>
          </body>
        </topic>
        <topic id="SERVERS">
          <title>SERVERS</title>
          <body>
            <table frame="all" id="table_imj_2dl_gs">
              <title>Servers</title>
              <tgroup cols="2">
                <colspec colname="c1" colnum="1" colwidth="1*"/>
                <colspec colname="c2" colnum="2" colwidth="2.78*"/>
                <thead>
                  <row>
                    <entry>Column</entry>
                    <entry>Description</entry>
                  </row>
                </thead>
                <tbody>
                  <row>
                    <entry>type</entry>
                    <entry>S, for server.</entry>
                  </row>
                  <row>
                    <entry>user</entry>
                    <entry>User ID that <codeph>pgbouncer</codeph> uses to connect to
                      server.</entry>
                  </row>
                  <row>
                    <entry>database</entry>
                    <entry>Database name.</entry>
                  </row>
                  <row>
                    <entry>state</entry>
                    <entry>State of the pgbouncer server connection, one of <codeph>active</codeph>,
                        <codeph>used</codeph>, or <codeph>idle</codeph>.</entry>
                  </row>
                  <row>
                    <entry>addr</entry>
                    <entry>IP address of the Greenplum or PostgreSQL server.</entry>
                  </row>
                  <row>
                    <entry>port</entry>
                    <entry>Port of the Greenplum or PostgreSQL server.</entry>
                  </row>
                  <row>
                    <entry>local_addr</entry>
                    <entry>Connection start address on local machine.</entry>
                  </row>
                  <row>
                    <entry>local_port</entry>
                    <entry>Connection start port on local machine.</entry>
                  </row>
                  <row>
                    <entry>connect_time</entry>
                    <entry>When the connection was made.</entry>
                  </row>
                  <row>
                    <entry>request_time</entry>
                    <entry>When the last request was issued.</entry>
                  </row>
                  <row>
                    <entry>ptr</entry>
                    <entry>Address of the internal object for this connection. Used as unique
                      ID.</entry>
                  </row>
                  <row>
                    <entry>link</entry>
                    <entry>Address of gthe client connection the server is paired with.</entry>
                  </row>
                  <row>
                    <entry>remote_pid</entry>
                    <entry>Pid of backend server process. If the connection is made over Unix socket
                      and the OS supports getting process ID info, it is the OS pid. Otherwise it is
                      extracted from the cancel packet the server sent, which should be PID in case
                      server is PostgreSQL, but it is a random number in case server is another
                      PgBouncer.</entry>
                  </row>
                </tbody>
              </tgroup>
            </table>
          </body>
        </topic>
        <topic id="STATS">
          <title>STATS</title>
          <body>
            <p>Shows statistics.</p>
            <table frame="all" id="table_ubj_2dl_gs">
              <title>Stats</title>
              <tgroup cols="2">
                <colspec colname="c1" colnum="1" colwidth="1*"/>
                <colspec colname="c2" colnum="2" colwidth="2.7*"/>
                <thead>
                  <row>
                    <entry>Column</entry>
                    <entry>Description</entry>
                  </row>
                </thead>
                <tbody>
                  <row>
                    <entry>database</entry>
                    <entry>Statistics are presented per database.</entry>
                  </row>
                  <row>
                    <entry>total_requests</entry>
                    <entry>Total number of <codeph>SQL</codeph> requests pooled by
                        <codeph>pgbouncer</codeph>.</entry>
                  </row>
                  <row>
                    <entry>total_received</entry>
                    <entry>Total volume in bytes of network traffic received by
                        <codeph>pgbouncer</codeph>.</entry>
                  </row>
                  <row>
                    <entry>total_sent</entry>
                    <entry>Total volume in bytes of network traffic sent by
                        <codeph>pgbouncer</codeph>.</entry>
                  </row>
                  <row>
                    <entry>total_query_time</entry>
                    <entry>Total number of microseconds spent by <codeph>pgbouncer</codeph> when
                      actively connected to the database server.</entry>
                  </row>
                  <row>
                    <entry>avg_req</entry>
                    <entry>Average requests per second in last stat period.</entry>
                  </row>
                  <row>
                    <entry>avg_recv</entry>
                    <entry>Average received (from clients) bytes per second.</entry>
                  </row>
                  <row>
                    <entry>avg_sent</entry>
                    <entry>Average sent (to clients) bytes per second.</entry>
                  </row>
                  <row>
                    <entry>avg_query</entry>
                    <entry>Average query duration in microseconds.</entry>
                  </row>
                </tbody>
              </tgroup>
            </table>
          </body>
        </topic>
        <topic id="USERS">
          <title>USERS</title>
          <body>
            <table frame="all" id="table_fyj_2dl_gs">
              <title>Users</title>
              <tgroup cols="2">
                <colspec colname="c1" colnum="1" colwidth="1*"/>
                <colspec colname="c2" colnum="2" colwidth="2.7*"/>
                <thead>
                  <row>
                    <entry>Column</entry>
                    <entry>Description</entry>
                  </row>
                </thead>
                <tbody>
                  <row>
                    <entry>name</entry>
                    <entry>The user name</entry>
                  </row>
                  <row>
                    <entry>pool_mode</entry>
                    <entry>The user's override pool_mode, or NULL if the default will be used
                      instead.</entry>
                  </row>
                </tbody>
              </tgroup>
            </table>
          </body>
        </topic>
        <topic id="VERSION">
          <title>VERSION</title>
          <body>
            <p>Display PgBouncer version information.</p>
            <note>This reference documentation is based on the PgBouncer 1.6.1 documentation.</note>
          </body>
        </topic>
      </topic>
    </topic>
  </topic>
</dita>
